.TH std::atomic_flag::clear 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::atomic_flag::clear \- std::atomic_flag::clear

.SH Synopsis
   Defined in header <atomic>
   void clear( std::memory_order order =                          \fB(1)\fP \fI(since C++11)\fP
                   std::memory_order_seq_cst ) volatile noexcept;
   void clear( std::memory_order order =                          \fB(2)\fP \fI(since C++11)\fP
                   std::memory_order_seq_cst ) noexcept;

   Atomically changes the state of a std::atomic_flag to clear (false).

   If order is one of std::memory_order_consume, std::memory_order_acquire and
   std::memory_order_acq_rel, the behavior is undefined.

.SH Parameters

   order - the memory synchronization ordering

   Defect reports

   The following behavior-changing defect reports were applied retroactively to
   previously published C++ standards.

      DR    Applied to          Behavior as published              Correct behavior
   LWG 2138 C++11      order could be std::memory_order_consume the behavior is
                                                                undefined in this case

.SH See also

                              atomically sets the flag to true and obtains its previous
   test_and_set               value
                              \fI(public member function)\fP
   atomic_flag_clear
   atomic_flag_clear_explicit atomically sets the value of the flag to false
   \fI(C++11)\fP                    \fI(function)\fP
   \fI(C++11)\fP
   memory_order               defines memory ordering constraints for the given atomic
   \fI(C++11)\fP                    operation
                              \fI(enum)\fP
